Nevron Open Vision Documentation
Barcodes / Matrix (2D) Barcodes
In This Topic
    Matrix (2D) Barcodes
    In This Topic

    A matrix code, also termed a 2D barcode or simply a 2D code, is a two-dimensional way to represent information. The advantage of 2D vs 1D barcodes is that they can represent significantly more data per unit area.

    Nevron Open Vision provides full support for two of the most popular 2D barcode symbologies - QR Code and PDF417. To create 2D barcode widgets you should create an instance of the NMatrixBarcode class and set its symbology and text.

     QR Code

    QR code can encode up to 7089 characters depending on their type (digits only, capital latin letters and digits, binary). Nevron's barcode component analyzes the type of characters you want to encode as a QR code and chooses automatically the best encoding method.

    A typical QR code looks like this:

    The large black squares at the corners are used by QR code scanners to determine whether the QR code is rotated and if yes by how much. This greatly improves scanning speed. The little square in between contain the actual data. The more data you want to encode, the more little squares will be needed to encode it and the bigger the QR code version (can be from 1 to 40). Nevron Open Vision automatically determines the version of the QR code based on the amount of data to encode.

    QR codes are widely used today. They are displayed on many different devices and printed on all kinds of surfaces, which unfortunately may lead to damaging the structure of the QR code image. That is where the error correction features of the QR code come in handy. Nevron Open Vision supports all 4 levels of QR code error correction and you can set the desired level through the ErrorCorrection property of the QR code.

    • Level L (Low) - 7% of code words can be restored. This is the default value used by Nevron QR codes.
    • Level M (Medium) - 15% of code words can be restored.
    • Level Q (Quartile) - 25% of code words can be restored.
    • Level H (High) - 30% of code words can be restored.

    The following code snippet shows how to create the QR code barcode widget shown above:

    Create QR Code widget
    Copy Code
    NMatrixBarcode barcode = new NMatrixBarcode();
    barcode.Symbology = ENMatrixBarcodeSymbology.QrCode;
    barcode.Text = "https://www.nevron.com";
    
     PDF417

    PDF417 is a popular 2D barcode format that is used in a variety of applications primarily transport, identification cards, and inventory management.

    This PDF417 barcode can be created with the following piece of code:

    Create PDF417 Barcode
    Copy Code
    NMatrixBarcode barcode = new NMatrixBarcode();
    barcode.Symbology = ENMatrixBarcodeSymbology.Pdf417;
    barcode.Text = "Nevron";
    
     Data Matrix

    Data Matrix is a 2D matrix barcode symbology that can be used to encode text and numeric data. A Data Matrix barcode can store up to 2 335 alphanumeric characters. Data matrix barcodes feature very good error correction, which means the message can be recovered even when the barcode is severely damaged. Data Matrix barcodes are also considered more secure than QR codes and that is why they are preferred in high security scenarios (e.g. for military purposes). The disadvantage of Data Matrix barcodes over QR codes is that they can encode only numbers and latin letters, which QR codes can encode Unicode characters and are better suited for encoding messages that contain non-Latin characters (Cyrillic, Chinese, Japanese, etc.).

    To create this Data Matrix barcode, you can use the following piece of code:

    Create PDF417 Barcode
    Copy Code
    NMatrixBarcode barcode = new NMatrixBarcode();
    barcode.Symbology = ENMatrixBarcodeSymbology.DataMatrix;
    barcode.Text = "Nevron Software";
    

     

    See Also